<template>
	<view class="">
		<view class="wrap" v-for="(item,index) in list" :key="index">
			<view class="tit">
				{{item.tit}}
			</view>
			<view class="list">
				<view class="list-msg" v-for="(items,indexx) in item.item" :key="indexx" @click="goPage(items)">
					<view class="list-msg-img">
						<image :src="comApi+'crmebimage/public/content/2024/03/07/'+items.image" mode="">
						</image>
						<!-- <image :src="items.image" mode=""></image> -->
					</view>
					<view>{{items.tit}}</view>
				</view>
			</view>

		</view>
		<home></home>
	</view>
</template>

<script>
	import home from '@/components/home/index.vue'
	import {
		HTTP_ADMIN_URL,
		HTTP_REQUEST_URL,
		HEADER,
		TOKENNAME,
		HEADERPARAMS
	} from '@/config/app';
	import {
		homeDetail
	} from '@/api/togeterRich/family.js'
	export default {
		components: {
			home
		},
		data() {
			return {
				comApi: '',
				list: [{
						tit: '通知',
						item: [{
								image: 'icon_tzgg.png',
								tit: '通知公告',
								url: '/pagesA/villagers/index?type=2'
							},
							{
								image: 'icon_czdjs.png',
								tit: '村庄大记事',
								url: '/pagesA/family/bigMemories'
							},

						]
					},
					{
						tit: '服务',
						item: [{
								image: 'icon_cgmy.png',
								tit: '村规民约',
								url: '/pagesA/villagers/index?type=1'
							},
							{
								image: 'icon_jtda.png',
								tit: '家庭档案',
								url: '/pagesA/family/index'
							},
							{
								image: 'icon_rjhjts.png',
								tit: '人居环境投诉',
								url: '/pagesA/complaint/index'
							},
							{
								image: 'icon_tsjy.png',
								tit: '投诉记录',
								url: '/pagesA/complaint/record'
							},

						]
					}, {
						
						tit: '积分',
						item: [{
								image: 'icon_jfgz.png',
								tit: '积分申报',
								url: '/pagesA/family/declare'
							},

							{
								image: 'icon_jfkb.png',
								tit: '积分看板',
								url: '/pagesA/family/board'
							},
							{
								image: 'icon_jfph.png',
								tit: '积分排行',
								url: '/pagesA/family/ranking'
							},
							{
								image: 'icon_jfgs.png',
								tit: '积分公示',
								url: '/pagesA/family/publicity'
							}
						]
					},
				]
			}
		},
		onLoad() {
			uni.hideLoading()
			this.comApi = HTTP_ADMIN_URL
		},
		methods: {
			goPage(items) {
				if (items.tit == '家庭档案') {
					homeDetail().then(res => {
						uni.navigateTo({
							url: items.url
						})
					})
					return;
				}

				// console.log(url, 'zhehihoin')
				uni.navigateTo({
					url: items.url
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.wrap {
		margin: 10rpx auto;

		.list {
			flex-wrap: wrap;
			display: flex;

			.list-msg {
				margin: 0 10px;
				// width: 20%;
				text-align: center;

				.list-msg-img {
					width: 80rpx;
					height: 80rpx;
					margin: 20rpx auto;
					border-radius: 50%;

					image {
						border-radius: 50%;

						width: 100%;
						height: 100%;
					}
				}

			}
		}

		padding: 30rpx;
		// background: red;

		.tit {
			font-size: 28rpx;
			font-weight: 600;
			color: #000;
		}
	}
</style>